#!groovy
@Library('jenkinslib') _
//def tools = new org.devops.toolscolor()
def tools = new org.devops.tools()

pipeline{
  agent { node { label "master01" }   }
  environment {
        JAVA_HOME = '/usr/local/jdk-17'
    }
 
  stages{
    stage("checkout"){
      steps{
        script{
          tools.PrintMes("下载代码","green")
          checkout scmGit(branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: 'gitee', url: 'https://gitee.com/liufuliu/jenkinsproject.git']])
        }
    }
    }
    
    stage("mvnbuild"){
      steps{
        script{
          tools.PrintMes("开始编译","green")
          sh "/usr/local/apache-maven-3.9.9/bin/mvn clean package -DskipTest"  
        }
      }
    }

  }
}